<!DOCTYPE html>
<html>
<head>
<#include "/common/freemarker/include_css.ftl">
<title>EA平台</title>
</head>

             
<body class="fixed-sidebar full-height-layout gray-bg" style="overflow:hidden">
    <div id="wrapper">
        <!--左侧导航开始-->
        <nav class="navbar-default navbar-static-side" role="navigation">
            <div class="nav-close"><i class="fa fa-times-circle"></i>
            </div>
            <div class="sidebar-collapse">
                <ul class="nav" id="side-menu">
				   <li class="nav-header">
				        <div class="dropdown profile-element">
				           		 <a href="#">
				                     <i  style="color:white;font-size:22px;">MD</i> &nbsp;<span class=" m-t-xs"><strong class="font-bold">企业管理平台</strong></span>
				                </a>
				        </div>
				    </li>  
				 
			     	   
	
							<li>
		                        <a class="J_menuItem" href="<@context/>site/event/search.do"><i class="fa fa-list-alt"></i> <span class="nav-label">粉丝活动发布</span></a>
		                    </li>
		                    <#--		                    
		      				<li>
		                        <a class="J_menuItem" href="<@context/>site/sitewx/qrcodeSdk.do"><i class="fa fa-list-alt"></i> <span class="nav-label">微信SDK二维码</span></a>
		                    </li>
		                    -->
			                <li>
			                        <a class="J_menuItem" href="<@context/>ea/user/search.do"><i class="fa fa-list-alt"></i> <span class="nav-label">用户管理</span></a>
			                </li>		                    
                                    
                </ul>
            </div>
        </nav>
        <!--左侧导航结束-->
   
        <!--右侧部分开始-->
        <div id="page-wrapper" class="gray-bg dashbard-1">
            <div class="row border-bottom">
                <nav class="navbar navbar-static-top" role="navigation" style="margin-bottom: 0">
                    <div class="navbar-header"><a class="navbar-minimalize minimalize-styl-2 btn btn-primary " href="#"><i class="fa fa-bars"></i> </a> </div>
                    <#include "/include_home_top_msg.ftl">
                   
                </nav>
            </div>
           
            <div class="row J_mainContent" id="content-main">
                <iframe class="J_iframe" name="iframe0" width="100%" height="100%" src="<@context/>site/event/search.do" frameborder="0" data-id="index_v1.html" seamless></iframe>
            </div>
            
        </div>
     <#assign confirmDialogId="exitDialog">   
     <@confirmDialog id=confirmDialogId title="系统消息" content="确定要退出系统吗"  btnText="确 定" btnClick="doExit()"/>
     
     <#assign msgDialogId="msgDialog">  
     <@alertDialog id=msgDialogId title="系统消息" content=""   />
       
    <div id="pwd-form" class="modal fade" aria-hidden="true">
        <div class="modal-dialog">
            <div class="modal-content"> 
		      <div class="modal-header">
		        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
		        <h4 class="modal-title" id="myModalLabel">修改密码</h4>
		      </div>
                <div class="modal-body">
                    <div class="row">
                        <div class="col-sm-12">
                            <#--
                            <h3 class="m-t-none m-b">修改密码</h3>
                            -->
                            <form role="form" id="pwdForm">
                                <div class="form-group">
                                    <label><font color="*">旧密码：</label>
                                    <input type="password" id="oldPwd"  name="oldPwd" placeholder="请输入密码" class="form-control" >
                                </div>
                                <div class="form-group">
                                    <label><font color="*">新密码：</label>
                                    <input   type="password" id="newPwd" name="newPwd" placeholder="请输入密码" class="form-control required">
                                </div>
                                <div class="form-group">
                                    <label><font color="*">确认新密码：</label>
                                    <input  type="password" id="confirmPwd" name="confirmPwd" placeholder="请输入密码" class="form-control required">
                                </div>                                
                                <div  class="modal-footer">
                                    <label id="pwdUpdateMsg" style="color:red"></label>
                                    <button   class="btn btn-primary" type="button" onclick="modifyPwdSubmit()">提 交</button>
                                     
                                    <button type="button" class="btn btn-primary" data-dismiss="modal">关  闭</button>
                                    </button>
                                     
                                </div>

    
                            </form>
                        </div>
 
                    </div>
                               
                </div>
            </div>
        </div>
    </div>
       
       
	   	<#include "/common/freemarker/include_js.ftl">
	    <script>
	        function refreshFirstPage()
	        {
	        	document.all("iframe0").src="<@context/>activiti/activiti/menu_task_list.do";
	        }	
	        function doSelectMenuTab(  tabName, menuId)
	        {
	        	var bingo=false;
		        $(".page-tabs-content a").each( function() {
		       		var html=$(this).html();
	        		if (html.indexOf(tabName)>=0 ){
	        			$(this).click();
	        			bingo=true;
	        		}
	        	})
	        	if (bingo==false){
	        		$("#"+menuId).click(); 
	        	}
	        }	
	        
	        function modifyPwdSubmit(){
	        	 $('#pwdUpdateMsg').html("");
			    if(!$("#pwdForm").valid()){
			    	 return false;
			    }
			   
	       		var ajaxUrl="<@context/>ea/user/submitCurrentPwd.do";
	            var data = $("#pwdForm").serialize();
				$.ajax({
					type: "post",
					url: ajaxUrl,
					data: data,
					dataType: "json",
					cache: false,
					success: function(json){ 
					    if (json.status=="success"){
							//alert("密码修改成功");
							$('#pwd-form').modal('hide'); 
							$('#${msgDialogId}_content').html("密码修改成功");
							$('#${msgDialogId}').modal('show'); 
							
							$("#oldPwd").val(""); 
			    			$("#newPwd").val(""); 
			    			$("#confirmPwd").val("");
			    			
		    			}else{
		    				//$('#${msgDialogId}_content').html("密码修改失败!"+json.message);
							//$('#${msgDialogId}').modal('show')
							$('#pwdUpdateMsg').html("密码修改失败!"+json.message);
		    			}
					},
					error:function(json){
						//alert("密码修改失败!"+json.message);
						$('#${msgDialogId}_content').html("密码修改失败!"+json);
						$('#${msgDialogId}').modal('show'); 
					}
				});
		    }
		    
		    function doExit(){
	       		var ajaxUrl="<@context/>loginadmin/logout.do";
				$.ajax({
					type: "post",
					url: ajaxUrl,
					data: {},
					dataType: "json",
					cache: false,
					success: function(json){
						if (json.status=="success"){
		    				$('#${confirmDialogId}').modal('hide');
		    				window.location.href="<@context/>lang.do";
		    			}else{
		    				//alert("退出系统失败!"+json.message);
		    				window.location.href="<@context/>lang.do";
		    			}	
					},
					error:function(json){
						//alert("退出系统失败!"+json);
						window.location.href="<@context/>lang.do";
					}
				});
		    }
		    //查询待办条数
		    getSystemMessageNum();
			window.setInterval("getSystemMessageNum()",600000);
			function getSystemMessageNum(){
				 
		    	 $.ajax({
			           	url: '<@context/>ea/systemmessage/msgcount.do' ,  
			           	dataType: "json",
			           	type:'GET',
			           	success:function(result){
			           		$("#msgNumSpan").html(result.data);
			           	}
				});
				
			}
			 
			getTaskNum();
			window.setInterval("getTaskNum()",600000);
			function getTaskNum(){
				 
		    	 $.ajax({
			           	url: '<@context/>activiti/activiti/taskcount.do' , 
			           	dataType: "json",
			           	type:'GET',
			           	success:function(result){
			           		$("#taskNumSpan").html(result.data);
			           	}
				});
				
			}
 	 		 
	    </script>
   
</body>

</html>
